package site.assad.conf1;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import site.assad.conf.LogDao;
import site.assad.conf.LogonService;
import site.assad.conf.UserDao;

/**
 * Author: Al-assad 余林颖
 * E-mail: yulinying_1994@outlook.com
 * Date: 2017/11/30 17:07
 * Description: 统一对 LogDao，UserDao，LogonService 配置为 bean
 */

@Configuration
public class AppConfig {

    @Bean
    public UserDao userDao(){
        return new UserDao();
    }

    @Bean
    public LogDao logDao(){
        return new LogDao();
    }

    @Bean
    public LogonService logonService(){
        LogonService logonService = new LogonService();
        logonService.setUserDao(userDao());
        logonService.setLogDao(logDao());
        return logonService;
    }


}
